import { service } from "./Request";
import qs from "qs";

const usersApi = {
    // 获取所有用户
    getUsers(params) {
        return service({
            url: "/users",
            method: "get",
            params
        })
    },
    // 获取用户详情
    getUserDetail(id) {
        return service({
            url: `/users/${id}`,
            method: "get"
        })
    },
    // 创建用户
    createUser(data) {
        return service({
            url: "/users",
            method: "post",
            data
        })
    },
    // 更新用户信息
    updateUser(id, data) {
        return service({
            url: `/users/${id}`,
            method: "put",
            data
        })
    },
    // 删除用户
    deleteUser(id) {
        return service({
            url: `/users/${id}`,
            method: "delete"
        })
    }
};

export default usersApi; 